package jsu.weizixuan.likesystem.model.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.Objects;

/**
 * 
 * @TableName blog
 */
@TableName(value ="blog")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Blog {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 
     */
    private Long userId;

    /**
     * 标题
     */
    private String title;

    /**
     * 封面
     */
    private String coverImg;

    /**
     * 内容
     */
    private String content;

    /**
     * 点赞数
     */
    private Integer thumbCount;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;


    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        Blog blog = (Blog) o;
        return Objects.equals(id, blog.id) && Objects.equals(userId, blog.userId) && Objects.equals(title, blog.title) && Objects.equals(coverImg, blog.coverImg) && Objects.equals(content, blog.content) && Objects.equals(thumbCount, blog.thumbCount) && Objects.equals(createTime, blog.createTime) && Objects.equals(updateTime, blog.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, title, coverImg, content, thumbCount, createTime, updateTime);
    }
}